package com.qk.management.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.dto.operatelog.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import com.qk.vo.operatelog.OperateLogVO;
import org.springframework.stereotype.Service;

/**
 * @Author:gzc
 * @Date: 2025/10/07 20:54
 * @Description:
 */
@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {

    @Override
    public PageResult<OperateLogVO> queryListByPage(OperateLogDTO operateLogDTO) {
        IPage<OperateLogVO> operateLogIPage = this.baseMapper.queryListByPage(new Page<>(operateLogDTO.getPage(), operateLogDTO.getPageSize()), operateLogDTO);
        return PageResult.<OperateLogVO>builder()
                .total(operateLogIPage.getTotal())
                .rows(operateLogIPage.getRecords())
                .build();
    }
}
